package com.sj.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 标签文章关联表
 * </p>
 *
 * @author 孙峻
 * @since 2022-03-09
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("article_label")
@ApiModel(value = "ArticleLabel对象", description = "标签文章关联表")
public class ArticleLabel implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("关联表id 无意义，自增长")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("标签id")
    private Integer labelId;

    @ApiModelProperty("文章id")
    private Integer articleId;

    @ApiModelProperty("是否删除 1 删除 0 未删除")
    @TableLogic
    private Boolean del;

    public static ArticleLabelBuilder builder() {
        return new ArticleLabelBuilder();
    }

    public static final class ArticleLabelBuilder {
        private Integer id;
        private Integer labelId;
        private Integer articleId;
        private Boolean del;

        private ArticleLabelBuilder() {
        }

        public ArticleLabelBuilder id(Integer id) {
            this.id = id;
            return this;
        }

        public ArticleLabelBuilder labelId(Integer labelId) {
            this.labelId = labelId;
            return this;
        }

        public ArticleLabelBuilder articleId(Integer articleId) {
            this.articleId = articleId;
            return this;
        }

        public ArticleLabelBuilder del(Boolean del) {
            this.del = del;
            return this;
        }

        public ArticleLabel build() {
            ArticleLabel articleLabel = new ArticleLabel();
            articleLabel.setId(id);
            articleLabel.setLabelId(labelId);
            articleLabel.setArticleId(articleId);
            articleLabel.setDel(del);
            return articleLabel;
        }
    }
}
